<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <script>
            let today=new Date();

            //获取日期
            let year=today.getFullYear();//获取年
            let month=today.getMonth();//获取月份，[0-11]
            let date=today.getDate();//获取日期
            let hours=today.getHours();//获取时
            let minutes=today.getMinutes();//获取分
            let seconds=today.getSeconds();//获取秒
            console.log(year+"年"+(month+1)+"月"+date+"日"+hours+":"+minutes+":"+seconds);
            let time=today.getTime();
            console.log(time);//从1970至今之间的毫秒值
            let day=today.getDay();//[0-6]
            console.log(day);

            //设置日期
            today.setDate(date+6);
            console.log(today);


        </script>
    </head>
    <body>
        
    </body>
</html>